package cn.easybuy.service;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import cn.easybuy.biz.BuycarBiz;
import cn.easybuy.biz.Impl.BuycarBizImpl;
import cn.easybuy.entity.Buycar;

public class findtrolley extends HttpServlet {

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		request.setCharacterEncoding("utf-8");
		response.setContentType("text/html;charset=utf-8");
		Buycar buycar = new Buycar();
		HttpSession session = request.getSession();
		BuycarBiz buycarBiz = new BuycarBizImpl();
		List<Buycar> list = buycarBiz.getAlllistBuycars();
		if (list != null) {
			System.out.println(list);
			session.setAttribute("FINDBUYT", list);
			response.sendRedirect("../BuyCar.jsp");
		} else {
			System.out.println(22);
		}
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		this.doGet(request, response);
	}

}
